package com.naiterui.ehp.bs.wechat.constants;

import com.naiterui.ehp.bp.utils.lang.ConfigUtil;

/**
 * 微信开发所使用到的常量类.
 *
 * @author Daniel Qian & binarywang
 */
public class WeChatConstant {

    /**
     * 微信回调默认返回成功
     */
    public static String RESPONSE_SUCCESS = "success";
    /**
     * 服务号主账号id
     */
    public static String PA_ACCOUNT_ID = ConfigUtil.getString("wechat.pa.account.id");

    public static class WeChatType {
        /**
         * 小程序
         */
        public static final String MP = "mini_program";
        /**
         * 公众号
         */
        public static final String PA = "public_account";
    }

    /**
     * 微信推送过来的消息的类型，和发送给微信xml格式消息的消息类型.
     */
    public static class XmlMsgType {
        /**
         * 文本消息
         */
        public static final String TEXT = "text";
        /**
         * 图片消息
         */
        public static final String IMAGE = "image";
        /**
         * 语音消息
         */
        public static final String VOICE = "voice";
        /**
         * 短视频消息
         */
        public static final String SHORTVIDEO = "shortvideo";
        /**
         * 视频消息
         */
        public static final String VIDEO = "video";
        /**
         * 图文消息
         */
        public static final String NEWS = "news";
        /**
         * 音乐
         */
        public static final String MUSIC = "music";
        /**
         * 地理位置
         */
        public static final String LOCATION = "location";
        /**
         * 超链接
         */
        public static final String LINK = "link";
        /**
         * 事件
         */
        public static final String EVENT = "event";
        public static final String DEVICE_TEXT = "device_text";
        public static final String DEVICE_EVENT = "device_event";
        public static final String DEVICE_STATUS = "device_status";
        public static final String HARDWARE = "hardware";
        /**
         * 新版客服功能-将消息转发到客服
         */
        public static final String TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";
    }

    /**
     * 主动发送消息(即客服消息)的消息类型.
     */
    public static class KefuMsgType {
        /**
         * 文本消息.
         */
        public static final String TEXT = "text";
        /**
         * 图片消息.
         */
        public static final String IMAGE = "image";
        /**
         * 语音消息.
         */
        public static final String VOICE = "voice";
        /**
         * 视频消息.
         */
        public static final String VIDEO = "video";
        /**
         * 音乐消息.
         */
        public static final String MUSIC = "music";
        /**
         * 图文消息（点击跳转到外链）.
         */
        public static final String NEWS = "news";
        /**
         * 图文消息（点击跳转到图文消息页面）.
         */
        public static final String MPNEWS = "mpnews";
        /**
         * 发送文件（CP专用）.
         */
        public static final String FILE = "file";
        /**
         * 文本卡片消息（CP专用）.
         */
        public static final String TEXTCARD = "textcard";
        /**
         * 卡券消息.
         */
        public static final String WXCARD = "wxcard";
        /**
         * 转发到客服的消息.
         */
        public static final String TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";

        /**
         * 小程序卡片(要求小程序与公众号已关联)
         */
        public static final String MINIPROGRAMPAGE = "miniprogrampage";
    }

    /**
     * 表示是否是保密消息，0表示否，1表示是，默认0.
     */
    public static class KefuMsgSafe {
        public static final String NO = "0";
        public static final String YES = "1";
    }

    /**
     * 群发消息的消息类型.
     */
    public static class MassMsgType {
        public static final String MPNEWS = "mpnews";
        public static final String TEXT = "text";
        public static final String VOICE = "voice";
        public static final String IMAGE = "image";
        public static final String MPVIDEO = "mpvideo";
    }

    /**
     * 被动回复消息类型
     */
    public static class AnswerMsgType {
        public static final String NEWS = "news";
        public static final String TEXT = "text";
        public static final String VOICE = "voice";
        public static final String IMAGE = "image";
        public static final String VIDEO = "video";
        public static final String MUSIC = "music";
    }

    /**
     * 生成公众号带参数二维码，类型
     */
    public static class PaActionType {
        /**
         * 二维码类型，QR_SCENE为临时的整型参数值
         */
        public static final String QR_SCENE = "QR_SCENE";
        /**
         * 二维码类型，QR_STR_SCENE为临时的字符串参数值
         */
        public static final String QR_STR_SCENE = "QR_STR_SCENE";
        /**
         * 二维码类型，QR_LIMIT_SCENE为永久的整型参数值
         */
        public static final String QR_LIMIT_SCENE = "QR_LIMIT_SCENE";
        /**
         * 二维码类型，QR_LIMIT_STR_SCENE为永久的字符串参数值
         */
        public static final String QR_LIMIT_STR_SCENE = "QR_LIMIT_STR_SCENE";
    }

    /**
     * 微信端推送过来的事件类型.
     * <p>
     * 在微信用户和公众号产生交互的过程中，用户的某些操作会使得微信服务器通过事件推送的形式通知到开发者在开发者中心处设置的服务器地址，从而开发者可以获取到该信息。其中，某些事件推送在发生后，是允许开发者回复用户的，某些则不允许，详细内容如下：
     * <p>
     * 目录
     * <p>
     * 1 关注/取消关注事件
     * <p>
     * 2 扫描带参数二维码事件
     * <p>
     * 3 上报地理位置事件
     * <p>
     * 4 自定义菜单事件
     * <p>
     * 5 点击菜单拉取消息时的事件推送
     * <p>
     * 6 点击菜单跳转链接时的事件推送
     * </p>
     */
    public static class EventType {
        public static final String SUBSCRIBE = "subscribe";
        public static final String UNSUBSCRIBE = "unsubscribe";
        public static final String SCAN = "SCAN";
        public static final String LOCATION = "LOCATION";
        public static final String CLICK = "CLICK";
        public static final String VIEW = "VIEW";
        public static final String MASS_SEND_JOB_FINISH = "MASSSENDJOBFINISH";
        /**
         * 扫码推事件的事件推送
         */
        public static final String SCANCODE_PUSH = "scancode_push";
        /**
         * 扫码推事件且弹出“消息接收中”提示框的事件推送.
         */
        public static final String SCANCODE_WAITMSG = "scancode_waitmsg";
        /**
         * 弹出系统拍照发图的事件推送.
         */
        public static final String PIC_SYSPHOTO = "pic_sysphoto";
        /**
         * 弹出拍照或者相册发图的事件推送.
         */
        public static final String PIC_PHOTO_OR_ALBUM = "pic_photo_or_album";
        /**
         * 弹出微信相册发图器的事件推送.
         */
        public static final String PIC_WEIXIN = "pic_weixin";
        /**
         * 弹出地理位置选择器的事件推送.
         */
        public static final String LOCATION_SELECT = "location_select";

        public static final String TEMPLATE_SEND_JOB_FINISH = "TEMPLATESENDJOBFINISH";
        /**
         * 微信小店 订单付款通知.
         */
        public static final String MERCHANT_ORDER = "merchant_order";

        /**
         * 卡券事件：卡券通过审核
         */
        public static final String CARD_PASS_CHECK = "card_pass_check";

        /**
         * 卡券事件：卡券未通过审核
         */
        public static final String CARD_NOT_PASS_CHECK = "card_not_pass_check";

        /**
         * 卡券事件：用户领取卡券
         */
        public static final String CARD_USER_GET_CARD = "user_get_card";

        /**
         * 卡券事件：用户转赠卡券
         */
        public static final String CARD_USER_GIFTING_CARD = "user_gifting_card";


        /**
         * 卡券事件：用户核销卡券
         */
        public static final String CARD_USER_CONSUME_CARD = "user_consume_card";


        /**
         * 卡券事件：用户通过卡券的微信买单完成时推送
         */
        public static final String CARD_USER_PAY_FROM_PAY_CELL = "user_pay_from_pay_cell";


        /**
         * 卡券事件：用户提交会员卡开卡信息
         */
        public static final String CARD_SUBMIT_MEMBERCARD_USER_INFO = "submit_membercard_user_info";

        /**
         * 卡券事件：用户打开查看卡券
         */
        public static final String CARD_USER_VIEW_CARD = "user_view_card";

        /**
         * 卡券事件：用户删除卡券
         */
        public static final String CARD_USER_DEL_CARD = "user_del_card";

        /**
         * 卡券事件：用户在卡券里点击查看公众号进入会话时（需要用户已经关注公众号）
         */
        public static final String CARD_USER_ENTER_SESSION_FROM_CARD = "user_enter_session_from_card";

        /**
         * 卡券事件：当用户的会员卡积分余额发生变动时
         */
        public static final String CARD_UPDATE_MEMBER_CARD = "update_member_card";

        /**
         * 卡券事件：当某个card_id的初始库存数大于200且当前库存小于等于100时，用户尝试领券会触发发送事件给商户，事件每隔12h发送一次
         */
        public static final String CARD_SKU_REMIND = "card_sku_remind";

        /**
         * 卡券事件：当商户朋友的券券点发生变动时
         */
        public static final String CARD_PAY_ORDER = "card_pay_order";

        /**
         * 小程序审核事件：审核通过
         */
        public static final String WEAPP_AUDIT_SUCCESS = "weapp_audit_success";

        /**
         * 小程序审核事件：审核不通过
         */
        public static final String WEAPP_AUDIT_FAIL = "weapp_audit_fail";

        /**
         * 订阅通知事件
         */
        public static final String SUBSCRIBE_MSG_POPUP_EVENT = "subscribe_msg_popup_event";
    }

    /**
     * 上传多媒体（临时素材）文件的类型.
     */
    public static class MediaFileType {
        public static final String IMAGE = "image";
        public static final String VOICE = "voice";
        public static final String VIDEO = "video";
        public static final String THUMB = "thumb";
        public static final String FILE = "file";
    }

}
